home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / asppw112 / fileleng.asp < prev    next >
Encoding:
Text File  |  1999-01-07  |  1.1 KB  |  44 lines

  1. <HTML><BODY>
  2. <%
  3.     ' Method: ReadFileLength(strFileName)
  4.     '
  5.     ' Sample Operation:
  6.     ' Read file size of sample.txt.
  7.     '
  8.     ' This file is provided as part of  ASP Power Widgets Samples
  9.     '
  10.     ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
  11.     ' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
  12.     ' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
  13.     ' OF MERCHANTABILITY AND/OR FITNESS FOR A  PARTICULAR
  14.     ' PURPOSE.
  15.  
  16.     ' Copyright 1997-1998. All rights reserved.
  17.     ' Dalun Software Inc. ASP Power Widgets
  18.     ' http://www.dalun.com
  19.     ' http://members.tripod.com/ActiveServerPage/
  20.  
  21.  
  22.     sFileName = "sample.txt"
  23.     sFileName = Server.MapPath("/") & "\" & sFileName
  24.  
  25.     response.write "File length of """  & sFileName & """ to be readed.<br>"
  26.      
  27.     Set oFDMgt   = Server.CreateObject("ASPPW.FDMgt")
  28.     lReturnCode  = oFDMgt.ReadFileLength(sFileName)
  29.     if lReturnCode = -1 then
  30.         response.write "File not found."
  31.     else
  32.         response.write "The file length is: " & CLng(lReturnCode) & "."
  33.     end if
  34.  
  35.     Set oFDMgt   =  nothing
  36.     
  37. %>
  38. </BODY></HTML>
  39.  
  40.  
  41.  
  42.  
  43.  
  44.